<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./js/jquery-1.12.4.js"></script>
    <link rel="stylesheet" href="./css/reset.css">
    
    <style>
        html{
            background-image: url('imgs/2.jpg');
            background-size: 100%;
        }
        ul {
            width: 220px;
            /* margin: 0 auto; */
            float: left;
            height: 700px;
            background-color: rgba(0, 0, 0, 0.3);
            margin-top: 20px;
            border-radius: 10px;
        }
        
        li {
            float: left;
            list-style: none;
            margin-top: 10px;
        }
        
        .small {
            width: 180px;
        }


        .imgs {
            /* background-color: rgba(0, 0, 0, 0.3); */
            display: none;
            border-radius: 10px;
        }
        #skin {
            width: 100px;
            height: 40px;
            background-color: rgba(0, 0, 0, 0.3);
            border: 0;
            border-radius: 5px;
            color: white;
        }
    </style>
</head>
<body>
    <!-- <button id="skin">么么哒</button> -->
    <div class="imgs">     
        <ul id="ul1">
            <li><a href="imgs/1.jpg"><img src="imgs/1.jpg" alt="" class="small" /></a></li>
            <li><a href="imgs/2.jpg"><img src="imgs/2.jpg" alt="" class="small" /></a></li>
            <li><a href="imgs/3.jpg"><img src="imgs/3.jpg" alt="" class="small" /></a></li>
            <li><a href="imgs/4.jpg"><img src="imgs/4.jpg" alt="" class="small" /></a></li>
            <li><a href="imgs/5.jpg"><img src="imgs/5.jpg" alt="" class="small" /></a></li>
        </ul>
    </ul>
    </div>

    <div class="wrap">
        <!--    /*包裹所有元素的容器*/-->
            <div class="cube">
                <!--前面图片 -->
                <div class="out_front">
                    <img src="img/1.jpg"  class="pic"/>
                </div>
                <!--后面图片 -->
                <div class="out_back">
                    <img src="img/2.jpg"  class="pic"/>
                </div>
                <!--左图片 -->
                <div class="out_left">
                    <img src="img/3.jpg"  class="pic"/>
                </div>
                <div class="out_right">
                    <img src="img/4.jpg"  class="pic"/>
                </div>
                <div class="out_top">
                    <img src="img/5.jpg"  class="pic"/>
                </div>
                <div class="out_bottom">
                    <img src="img/6.jpg"  class="pic"/>
                </div>
                <!--小正方体 --> 
                
                
                <span class="in_front">
                    <img src="img/7.jpg" class="in_pic" />
                </span>
                <span class="in_back">
                     <img src="img/8.jpg" class="in_pic" />
                </span>
                <span class="in_left">
                    <img src="img/9.jpg" class="in_pic" />
                </span>
                <span class="in_right">
                    <img src="img/10.jpg" class="in_pic" />
                </span>
                <span class="in_top">
                    <img src="img/11.jpg" class="in_pic" />
                </span>
                <span class="in_bottom">
                    <img src="img/12.jpg" class="in_pic" />
                </span>
            </div>
            </div>
            <audio id='audio' src="./mp3/丁可-If.mp3" autoplay="autoplay" ></audio>

    <script>
        $('#skin').on('click',function(){
            $('.imgs').css('display','block');
        });
        $('#ul1>li>a').on('click',function(e){
            e.preventDefault()
            let imga = $(this).css('href');
            $('html').css('background-image',`url('${$(this).attr('href')}')`);
            $('.imgs').css('display','none');
        });
        $('#ul1').on('click',function(){
            $('.imgs').css('display','none');
        });
        let indexs = 1;
        function lunbo(){
            indexs++;
            if(indexs == 6){
                indexs=1;
            }
            $('html').css('background-image',`url(imgs/${indexs}.jpg)`);
        }
        setInterval(lunbo,3000);


        function toggleSound() {
            let music = document.getElementById("audio");//获取ID  
                // console.log(music);
                // console.log(music.paused);
            if (music.paused) { //判读是否播放  
                music.paused=false;
                music.play(); //没有就播放 
            }              
        }
        setInterval("toggleSound()",1);
    </script>
</body>
</html>